
from ab_alg_generator import *
from GameManager import GameManger
from ai_alg_generator import *
from str_color import bcolors
from TemplateSolver import TemplateSolver
import os

'''
该模组为实例化的控制台应用游戏
'''


def init_game():
    os.system('cls')
    print(f'{bcolors.FAIL}请设置玩家一的值:{bcolors.RESET}')
    red_player_value = int(input())

    print(f'{bcolors.OKBLUE}请设置玩家二的值:{bcolors.RESET}')
    blue_player_value = int(input())

    print(f'{bcolors.HEADER}*请设置先手玩家:{bcolors.RESET}')
    first_round = int(input())

    return red_player_value, blue_player_value, first_round


if __name__ == '__main__':
    solver_1 = ABSolver()
    solver_2 = ABSolver()
    gameInstance = GameManger(GUI_ON=True)
    frame = Frame(1, 2, 2, 0, 0, Board().template_board())
    # gameInstance.set_frame(frame)
    # 传入算法就可

    # gameInstance.auto_game_loop(Cupidity, Cupidity, is_print_board=True)
    gameInstance.auto_game_loop(use_solver=True, solver_1=solver_1, solver_2=solver_2, is_print_board=True)
